#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDir>
#include <QDebug>

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    setWindowTitle("二维码生成器");
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::on_pushButton_clicked()
{
    QString data = ui->lineEdit->text();
    if(data.isEmpty()){
        return;
    }
    SmallTool::instance()->CreateRcode(data);
    QString path = QDir::currentPath()+"/QRcode.png";

    qDebug()<<path;
    ui->label_2->setPixmap(QPixmap(path));
}
